Skip to content

docs(android): Introduce Android ProfilingManager options#18481

Open
markushi wants to merge 2 commits into
masterfrom
feat/android-profiling-manager
Open

docs(android): Introduce Android ProfilingManager options#18481
markushi wants to merge 2 commits into
masterfrom
feat/android-profiling-manager

Conversation

@markushi

@markushi markushi commented Jun 18, 2026

Copy link
Copy Markdown
Member

DESCRIBE YOUR PR

Introduce new docs for Android ProfilingManager.

Warning

do not merge before getsentry/sentry-java#5251

IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs to go live.

  • Urgent deadline (GA date, etc.):
  • Other deadline:
  • None: Not urgent, can wait up to 1 week+

SLA

  • Teamwork makes the dream work, so please add a reviewer to your PRs.
  • Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it.
    Thanks in advance for your help!

PRE-MERGE CHECKLIST

Make sure you've checked the following before merging your changes:

@vercel

vercel Bot commented Jun 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sentry-docs Ready Ready Preview, Comment Jun 19, 2026 6:13am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
develop-docs Ignored Ignored Preview Jun 19, 2026 6:13am

Request Review

UI Profiling relies on the Android ProfilingManager, which rate limits
profiling requests at the framework level on top of the SDK sampling
rate. Document this in the Limitations section and add a callout with the
shell command to disable the restrictions for local testing.

Co-Authored-By: Claude <noreply@anthropic.com>

<SdkOption name="useProfilingManager" type="bool" defaultValue="false" availableSince="8.45.0">

When `true`, UI Profiling uses the Android <Link to="https://developer.android.com/reference/android/os/ProfilingManager">ProfilingManager</Link> to capture <Link to="https://perfetto.dev/">Perfetto</Link> traces. This is the recommended backend and requires Android 15 (API level 35) or higher. On older devices, profiling won't run and there is no fallback to the legacy profiler. When `false`, the SDK uses the <PlatformLink to="/profiling/legacy">legacy `tracer` backend</PlatformLink>.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
When `true`, UI Profiling uses the Android <Link to="https://developer.android.com/reference/android/os/ProfilingManager">ProfilingManager</Link> to capture <Link to="https://perfetto.dev/">Perfetto</Link> traces. This is the recommended backend and requires Android 15 (API level 35) or higher. On older devices, profiling won't run and there is no fallback to the legacy profiler. When `false`, the SDK uses the <PlatformLink to="/profiling/legacy">legacy `tracer` backend</PlatformLink>.
When `true`, UI Profiling uses the Android <Link to="https://developer.android.com/reference/android/os/ProfilingManager">ProfilingManager</Link> to capture <Link to="https://perfetto.dev/">Perfetto</Link> traces. This is the preferred profiling implementation and requires Android 15 (API level 35) or higher. On older devices, profiling won't run and there is no fallback to the legacy profiler. When `false`, the SDK uses the <PlatformLink to="/profiling/legacy">legacy `tracer` backend</PlatformLink>.

---
title: Legacy Profiling
sidebar_title: Legacy Profiling
description: "Learn about the legacy profiling implementations and how to use them on devices below Android 15."

@coolguyzone coolguyzone Jun 23, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: "Learn about the legacy profiling implementations and how to use them on devices below Android 15."
description: "Learn about the legacy profilers and how to use them on devices running Android versions earlier than Android 15."


<Alert level="warning" title="Legacy">
This page documents Sentry's legacy Android profilers. The recommended way to
profile your app is the{" "}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
profile your app is the{" "}
profile your app is the is the <PlatformLink to="/profiling/">ProfilingManager (Perfetto) based UI Profiling</PlatformLink>, available since SDK version `8.45.0`. Use the legacy profilers only when you need to support devices running below Android 15 (API level 35), or while migrating from an older setup.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Putting this all on one line to fix a formatting issue.

<Alert level="warning" title="Legacy">
This page documents Sentry's legacy Android profilers. The recommended way to
profile your app is the{" "}
<PlatformLink to="/profiling/">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<PlatformLink to="/profiling/">

This page documents Sentry's legacy Android profilers. The recommended way to
profile your app is the{" "}
<PlatformLink to="/profiling/">
ProfilingManager (Perfetto) based UI Profiling

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ProfilingManager (Perfetto) based UI Profiling

profile your app is the{" "}
<PlatformLink to="/profiling/">
ProfilingManager (Perfetto) based UI Profiling
</PlatformLink>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
</PlatformLink>

Comment on lines +13 to +14
</PlatformLink>
, available since SDK version `8.45.0`. Use the legacy profilers only when you

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
</PlatformLink>
, available since SDK version `8.45.0`. Use the legacy profilers only when you

ProfilingManager (Perfetto) based UI Profiling
</PlatformLink>
, available since SDK version `8.45.0`. Use the legacy profilers only when you
need to support devices running below Android 15 (API level 35), or while

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
need to support devices running below Android 15 (API level 35), or while

</PlatformLink>
, available since SDK version `8.45.0`. Use the legacy profilers only when you
need to support devices running below Android 15 (API level 35), or while
migrating from an older setup.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
migrating from an older setup.

<Alert level="warning" title="Important">
Legacy UI Profiling and transaction-based profiling use the Android runtime's
`tracer` under the hood to sample threads. There are known issues that this
`tracer` can cause crashes in certain circumstances. See this{" "}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`tracer` can cause crashes in certain circumstances. See this{" "}
`tracer` can cause crashes in certain circumstances. See this <PlatformLink to="/profiling/troubleshooting#i-see-an-elevated-number-of-crashes-in-the-android-runtime-when-profiling-is-activated"> troubleshooting </PlatformLink> entry for more information. The ProfilingManager (Perfetto) based <PlatformLink to="/profiling/">UI Profiling</PlatformLink> is not affected by these issues.

Legacy UI Profiling and transaction-based profiling use the Android runtime's
`tracer` under the hood to sample threads. There are known issues that this
`tracer` can cause crashes in certain circumstances. See this{" "}
<PlatformLink to="/profiling/troubleshooting#i-see-an-elevated-number-of-crashes-in-the-android-runtime-when-profiling-is-activated">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<PlatformLink to="/profiling/troubleshooting#i-see-an-elevated-number-of-crashes-in-the-android-runtime-when-profiling-is-activated">

`tracer` under the hood to sample threads. There are known issues that this
`tracer` can cause crashes in certain circumstances. See this{" "}
<PlatformLink to="/profiling/troubleshooting#i-see-an-elevated-number-of-crashes-in-the-android-runtime-when-profiling-is-activated">
troubleshooting

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
troubleshooting

`tracer` can cause crashes in certain circumstances. See this{" "}
<PlatformLink to="/profiling/troubleshooting#i-see-an-elevated-number-of-crashes-in-the-android-runtime-when-profiling-is-activated">
troubleshooting
</PlatformLink>{" "}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
</PlatformLink>{" "}

<PlatformLink to="/profiling/troubleshooting#i-see-an-elevated-number-of-crashes-in-the-android-runtime-when-profiling-is-activated">
troubleshooting
</PlatformLink>{" "}
entry for more information. The ProfilingManager (Perfetto) based{" "}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
entry for more information. The ProfilingManager (Perfetto) based{" "}

troubleshooting
</PlatformLink>{" "}
entry for more information. The ProfilingManager (Perfetto) based{" "}
<PlatformLink to="/profiling/">UI Profiling</PlatformLink> is not affected by

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<PlatformLink to="/profiling/">UI Profiling</PlatformLink> is not affected by

</PlatformLink>{" "}
entry for more information. The ProfilingManager (Perfetto) based{" "}
<PlatformLink to="/profiling/">UI Profiling</PlatformLink> is not affected by
these issues.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
these issues.


## Legacy UI Profiling

Legacy UI Profiling is available starting in SDK version `8.7.0` and is supported on API level 21 and up.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Legacy UI Profiling is available starting in SDK version `8.7.0` and is supported on API level 21 and up.
Legacy UI Profiling is available starting with SDK version `8.7.0` and is supported on API level 21 and up.


<Alert>

This is the oldest profiling implementation and will eventually be deprecated. We recommend upgrading to the <PlatformLink to="/profiling/">ProfilingManager (Perfetto) based UI Profiling</PlatformLink>. The same behaviour, without the 30 seconds limitation, can be achieved with the trace lifecycle. In order to upgrade, you also need to remove the <PlatformLink to="/configuration/options/#transaction-based-profiling-options">transaction-based profiling options</PlatformLink> from your configuration.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This is the oldest profiling implementation and will eventually be deprecated. We recommend upgrading to the <PlatformLink to="/profiling/">ProfilingManager (Perfetto) based UI Profiling</PlatformLink>. The same behaviour, without the 30 seconds limitation, can be achieved with the trace lifecycle. In order to upgrade, you also need to remove the <PlatformLink to="/configuration/options/#transaction-based-profiling-options">transaction-based profiling options</PlatformLink> from your configuration.
This is the oldest profiling implementation and will eventually be deprecated. We recommend upgrading to the <PlatformLink to="/profiling/">ProfilingManager (Perfetto) based UI Profiling</PlatformLink>. The same behavior, without the 30 seconds limitation, can be achieved with the trace lifecycle. In order to upgrade, you also need to remove the <PlatformLink to="/configuration/options/#transaction-based-profiling-options">transaction-based profiling options</PlatformLink> from your configuration.

<Alert level="info" title="Improved Profiling Coming Soon">
We're working on a more stable profiling solution based on the Android <Link to="https://developer.android.com/reference/android/os/ProfilingManager">ProfilingManager APIs (Perfetto)</Link>. Follow the <Link to="https://github.com/getsentry/sentry-java/discussions/5560">discussion on GitHub</Link> for updates.
<Alert level="info" title="Using the recommended profiler?">
The crash-related issues below only affect{" "}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The crash-related issues below only affect{" "}
The crash-related issues below only affect <PlatformLink to="/profiling/legacy">Legacy Profiling</PlatformLink>, which uses the Android runtime's `tracer`. The recommended <PlatformLink to="/profiling/"> ProfilingManager (Perfetto) based UI Profiling </PlatformLink> is not affected.

We're working on a more stable profiling solution based on the Android <Link to="https://developer.android.com/reference/android/os/ProfilingManager">ProfilingManager APIs (Perfetto)</Link>. Follow the <Link to="https://github.com/getsentry/sentry-java/discussions/5560">discussion on GitHub</Link> for updates.
<Alert level="info" title="Using the recommended profiler?">
The crash-related issues below only affect{" "}
<PlatformLink to="/profiling/legacy">Legacy Profiling</PlatformLink>, which

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<PlatformLink to="/profiling/legacy">Legacy Profiling</PlatformLink>, which

<Alert level="info" title="Using the recommended profiler?">
The crash-related issues below only affect{" "}
<PlatformLink to="/profiling/legacy">Legacy Profiling</PlatformLink>, which
uses the Android runtime's `tracer`. The recommended{" "}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
uses the Android runtime's `tracer`. The recommended{" "}

The crash-related issues below only affect{" "}
<PlatformLink to="/profiling/legacy">Legacy Profiling</PlatformLink>, which
uses the Android runtime's `tracer`. The recommended{" "}
<PlatformLink to="/profiling/">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<PlatformLink to="/profiling/">

<PlatformLink to="/profiling/legacy">Legacy Profiling</PlatformLink>, which
uses the Android runtime's `tracer`. The recommended{" "}
<PlatformLink to="/profiling/">
ProfilingManager (Perfetto) based UI Profiling

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ProfilingManager (Perfetto) based UI Profiling

uses the Android runtime's `tracer`. The recommended{" "}
<PlatformLink to="/profiling/">
ProfilingManager (Perfetto) based UI Profiling
</PlatformLink>{" "}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
</PlatformLink>{" "}

<PlatformLink to="/profiling/">
ProfilingManager (Perfetto) based UI Profiling
</PlatformLink>{" "}
is not affected.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
is not affected.

## I see an elevated number of crashes in the Android Runtime when profiling is activated

Profiling uses the Android runtime's `tracer` under the hood to sample threads. There are known issues that this `tracer` can cause crashes in certain circumstances. Read on for more information, and subscribe to this <Link to="https://github.com/getsentry/sentry-java/issues/3679">GitHub issue</Link> for updates.
<PlatformLink to="/profiling/legacy">Legacy Profiling</PlatformLink> uses the

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please follow my examples above and put this in-line to fix the extra line breaks that are appearing here.

<Alert level="warning">
Profiling uses the Android runtime's `tracer` under the hood to sample threads. There are known issues that this `tracer` can cause crashes in certain circumstances. See this <PlatformLink to="/profiling/troubleshooting#i-see-an-elevated-number-of-crashes-in-the-android-runtime-when-profiling-is-activated">troubleshooting</PlatformLink> entry for more information.
<Alert level="info">
Profiling uses the Android{" "}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another section that needs to be in-lined.

@coolguyzone coolguyzone left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of the formatting needs adjusting, but once those are done this looks good to go!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants